<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>院校详情</title>
    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript"  src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="index.css">
  <link rel="stylesheet" href="main.css">
  <link rel="stylesheet" href="major.css">
  <link rel="stylesheet" href="shoolitemInfo.css">
  <link rel="stylesheet" href="./static/dist/css/bootstrap.css">
  <script type="text/javascript" src="./static/store.legacy.min.js"></script>
  <script src="./static/util.js"></script>
</head>
<body>
  <!-- 自主招生页面 -->
  <header>
    <div class="headerSwipper">
      <div class="headerSwipper_div">
        <div class="headerSwipper_div_iconview">
          <img src="./static/images/logo.png" alt="">
        </div>
        <div class="headerSwipper_div_myicon">
          <!-- <img src="" alt=""> -->
          <span class="loginText">登录</span>
          <div class="headerSwipper_div_myicon_icon" style="display: none">
            <img src="./static/images/iconsmall.png" alt="">
          </div>
          <div class="headerSwipper_div_myicon_info">
            <ul>
              <li class="headerSwipper_div_myicon_info_li">消息</li>
              <li class="headerSwipper_div_myicon_info_li">退出</li>
            </ul>
          </div>
        </div>
        <ul class="headerSwipper_div_ul">
          <li class="headerSwipper_div_li mobileapp">手机APP</li>
          <li class="headerSwipper_div_li vipprop">开通VIP</li>
        </ul>
      </div>
    </div>
  </header>
  <section>
    <div class="ImgSwipperview middleheight schoolimgview">
      <img class="ImgSwipperview_img schoolimgview_img" src="./static/images/magioback.png" alt="">
      <ul>
        <li class="universityView schoolimgview_li" id="111">
          <span class="universityImgview"><img class="universityImgview_img borderra" src="" alt=""></span>
          <div class="universitytext">
            <span class="universitytext_title"></span>
            <p class="universitytext_lable"></p>
          </div>
          <div class="addWish_shool">
            <span class="addWishImgview_school">
              <img class="addWishImgview_school_img" src="./static/images/collect_not.png" alt="">
            </span>
          </div>
        </li>

      </ul>
    </div>
  </section>
  <section>
    <div class="mainContentView">
      <div class="contentView">
        <!-- 上侧导航 -->
        <div class="topnav">
          <ul class="contentView_ul">
            <li class="contentView_li contentView_li_active">首页</li>
            <li class="contentView_li">学习中心</li>
            <li class="contentView_li">志愿填报</li>
            <li class="contentView_li">微课</li>
            <li class="contentView_li">模拟试题</li>
            <li class="contentView_li">往届真题</li>
            <li class="contentView_li">咨询</li>
          </ul>
          <div class="inputview">
            <input class="inputview_input" id="tag" 
 type="text" placeholder="搜索院校">
            <img  class="searchicon_img" src="./static/images/searchicon.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 学习中心 -->
  <section class="learnCenterPage">
    <div class="learncenterview">
      <div class="learncenter">
        <!-- 自主招生页面 -->
        <div class="questionView recruitment_more">
          <!-- <ul class="subjectNav">
            <li class="subjectNav_li">语文</li>
          </ul> -->
          <div class="firstSwipper">
            <p class="segmentation moreSmallClass">
              <span class="segmentation_title">院校简介</span>
            </p>
            <ul class="questionView_ul recruitment_ul_more mainText_school_maxheight" id="text001">
            </ul>
            <p class="seemore">
              <span class="seemore_span" id="text1">展开查看更多</span>
            </p>
            <p class="segmentation moreSmallClass">
              <span class="segmentation_title">特色专业</span>
            </p>
            <ul class="questionView_ul recruitment_ul_more mainText_school_maxheight" id="text002">
  
            </ul>
            <p class="seemore">
              <span class="seemore_span" id="text2">展开查看更多</span>
            </p>
            <p class="segmentation moreSmallClass">
              <span class="segmentation_title">院系设置</span>
            </p>
            <ul class="questionView_ul recruitment_ul_more mainText_school_maxheight" id="text003">
  
            </ul>
            <p class="seemore">
              <span class="seemore_span" id="text3">展开查看更多</span>
            </p>
            <p class="segmentation moreSmallClass">
              <span class="segmentation_title">师资力量</span>
            </p>
            <ul class="questionView_ul recruitment_ul_more mainText_school_maxheight" id="text004">
  
            </ul>
            <p class="seemore">
              <span class="seemore_span" id="text4">展开查看更多</span>
            </p>
          </div>
          <!-- 第二个显示区域 -->
          <div class="secondSwipper">
            <div class="first_swipper_table swipper_table">
              <p class="segmentation moreSmallClass">
                <span class="segmentation_title">院校录取</span>
              </p>
              <p class="selectView">
                在<a class="address">河南</a>录取情况
                <select class="form-control type_select">
                </select>
                <select class="form-control back_select">
                </select>
              </p>
              <table class="table table-bordered table_style">
                <tr>
                  <td>年份</td>
                  <td>代码</td>
                  <td>最低分</td>
                  <td>投档分名次</td>
                  <td>招生专业</td>
                </tr>
              </table>
            </div>
            <div class="first_swipper_table swipper_table">
                <p class="segmentation moreSmallClass">
                  <span class="segmentation_title">专业录取</span>
                </p>
                <p class="selectView">
                  在<a class="address">河南</a>录取情况
                  <select class="form-control type_select">
                  </select>
                  <select class="form-control back_select">
                  </select>
                  <select class="form-control date_select">
                  </select>
                </p>
                <table class="table table-bordered table_style">
                  <tr>
                    <td>招生专业</td>
                    <td>最高分</td>
                    <td>平均分</td>
                    <td>最低分</td>
                    <td>录取数</td>
                  </tr>
                </table>
            </div>
            <div class="first_swipper_table swipper_table">
                <p class="segmentation moreSmallClass">
                  <span class="segmentation_title">招生计划</span>
                </p>
                <p class="selectView">
                  在<a class="address">河南</a>录取情况
                  <select class="form-control type_select">
                  </select>
                </p>
                <table class="table table-bordered table_style">
                  <tr>
                    <td>招生专业</td>
                    <td>层次</td>
                    <td>科类</td>
                    <td>计划数</td>
                  </tr>
                </table>
            </div>
          </div>
          <!-- 第三个显示区域 -->
          <div class="threeSwipper">
              <p class="segmentation moreSmallClass">
                <span class="segmentation_title">招生简章</span>
              </p>
              <ul class="questionView_ul recruitment_ul_more mainText_school_maxheight" id="text005">
              </ul>
              <p class="seemore">
                <span class="seemore_span" id="text5">展开查看更多</span>
              </p>
            </div>
        </div>
        <!-- 侧边区域 -->
        <div class="sideview">
          <p class="segmentation moreSmallClass ceilingLeft">
            <span class="segmentation_title">基本信息</span>
          </p>
          <p class="school_type">
            办学类型
            <span id="side001"></span>
          </p>
          <p class="school_type">
            学历层次
            <span id="side002"></span>
          </p>
          <p class="school_type">
            院校隶属
            <span id="side003"></span>
          </p>
          <p class="school_type">
            建校时间
            <span id="side004"></span>
          </p>
          <p class="school_type">
            院校地址
            <span id="side005">:河南省南阳市唐河县城管一初中边上的小卖部啊哈哈哈哈哈</span>
          </p>
          <p class="school_type">
            学生人数
            <span id="side006"></span>
          </p>
          <p class="school_type">
            院士人数
            <span id="side007"></span>
          </p>
          <p class="school_type">
            硕士点个数
            <span id="side008"></span>
          </p>
          <p class="school_type">
            博士点个数
            <span id="side009"></span>
          </p>
          <p class="school_type">
            官方网站
            <a id="side0010"></a>
          </p>
          <p class="school_type">
            招生网站
            <a id="side0011"></a>
          </p>
        </div>
      </div>
    </div>
  </section>


  <footer>
    <div class="footerSwipper">
      <div class="footerSwipper_div">
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span"><a href="./index.html">首页</a></span>
          <li class="footerSwipper_div_ul_li"><a href="./schools.html?keyword=">院校大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./major.html">专业大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mentality.html">心理辅导</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./careerPlanning.html">职业规划</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./infoTest.html">高考资讯</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=1">自主招生</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=2">单独招生</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">学习提升</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=3">微课</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=4">模拟试题</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=5">往届试题</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">志愿填报</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=6">咨询</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mobileapp.html">下载APP</a></li>
        </ul>
        <!-- 扫一扫关注我们区域 -->
        <div class="QRcodeSwipper">
          <span class="QRcodeSwipper_span">扫一扫关注我们</span>
          <div class="QRcodeSwipper_imgview">
            <img src="./static/images/qr.png" alt="">
          </div>
        </div>
        <!-- 中间信息区域 -->
        <div class="middleInfo">
          <span class="middleInfo_span_city">中国·河南·郑州</span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special phone_icon"><img src="./static/images/phone.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_color">0371-68064945</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/message.png" alt=""></span><span class="middleInfo_span_GE_text">595879735@qq.com</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/store.png" alt=""></span><span class="middleInfo_span_GE_text">河南柒佰伴教育信息咨询有限公司
          </span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special address_icon"><img src="./static/images/address.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_special">郑州市郑东新区立体世界
            </span></span>
        </div>
        <p class="footerSwipper_div_p">河南世霖网络软件科技 2014-2018 豫ICP备14010456号-1</p>
      </div>
    </div>
  </footer>
  <script src="./static/util.js"></script>
  <script src="./static/dist/js/bootstrap.js"></script>
  <script>
    $(document).ready(function(){
      // 初始化参数
      var currentpage = 1
      var pagestotal = 1
      var urllocation = location.href
      var id = getparse(urllocation, 0)
      var testQuestion = {school_id: id, uid: store.get('uid')}
      var possibleUrl = '/admin.php/api/homepage/school_detail'
      var index = 0
      var toptype = ['院校简介','院校数据','招生简章']
      // .learncenter 导入导航标签方法
      // ArrowNavigation($('.learncenter'),["main","smallClass"])
      // 登录隐藏
      $('.headerSwipper_div_myicon_info').hide()
      // 监听li选择事件
      $('.contentView_ul').on('click', '.contentView_li', function() {
        
      })
      // 渲染子页面数据 本页面控制显示隐藏 在第一次加载的时候调用
      function rendering () {
        $.ajax({
          url: urlhost + possibleUrl,
          method: 'POST',
          data: testQuestion,
          success: function (res) {
            console.log(res.data)
            var initdata = res.data
            var spanhtml = ''
            spanhtml += '<span class="universitytext_lable_span">'+ initdata.rank +'</span>'
            for(list in initdata) {
              if(list.slice(0, 5) == 'label') {
                if(initdata[list]) {
                  spanhtml += '<span class="universitytext_lable_span">'+ initdata[list] +'</span>'
                }
              }
            }
            // 加载院校名字 图片
            $('.universityImgview_img').attr('src', initdata.sch_pic)
            $('.universitytext_title').text(initdata.sch_name)
            // 加载院校标签
            $('.universitytext_lable').html(spanhtml)
            if(initdata.status == '1') {
              $('.addWishImgview_school_img').attr('src', './static/images/collect.png')
            }
            // 侧边栏加载
            var sideinfo = ['sch_type','sch_edu','sch_ls','sch_time','sch_address','sch_nums','sch_rs','master','doctor','sch_web','zs_web']
            for(var j = 1;j < 12;j++) {
              $('#side00' + j).text(':' + initdata[sideinfo[j-1]])
            }
            $('#side0010').attr('href',$('#side0010').text().substr(1,$('#side0010').text().length-1))
            $('#side0011').attr('href',$('#side0011').text().substr(1,$('#side0011').text().length-1))
            // 文字区域加载 text005
            var textinfo = ['sch_desc','sch_zy','yx_set','szll','zszc']
            for(var m = 1;m < 6;m++) {
              $('#text00' + m).html(initdata[textinfo[m-1]])
            }
          }
        })
      }
      // 试题上方科目选择列表 方法
      function subjectApply (item, subjects) {
        item.find('.subjectNav').remove()
        var subject = ''
        for(var i=0; i < subjects.length; i++) {
          if(i == 0) {
            subject += '<li class="subjectNav_li subjectNav_li_active" id="' + i + '">' + subjects[i] + '</li>'
          }else {
            subject += '<li class="subjectNav_li" id="' + i + '">' + subjects[i] + '</li>'
          }
        }
        subject = '<ul class="subjectNav">' + subject + '</ul>'
        item.prepend(subject)
      }
      var hideList = ['.firstSwipper', '.secondSwipper', '.threeSwipper']
      // 监听三个选项选择改变事件
      $('.recruitment_more').on('click', '.subjectNav_li', function (){
        clickchange($(this), '.subjectNav_li', 'subjectNav_li_active')
        var index = $(this).index()
        if(index == 1) {
          inittype()
        }
        for(var i=0; i < hideList.length; i++) {
          $(hideList[i]).hide()
        }
        $(hideList[index]).show()
      })
      // 监听查看详情事件
      $('.learncenterview').on('click', '.newsitemview', function() {
        var itemid = $(this).parents('li').attr('id').slice(14)
        window.location.href = './item.html?id=' + itemid
      })
      // 监听学校列表点击事件
      $('.learncenterview').on('click', '.universityView', function() {
        var itemid = $(this).attr('id').slice(6)
        window.location.href = './shoolitem.html?id=' + itemid
      })
      // 页面首页初始化
      function pageinit () {
        // var setindex = 0
        ArrowNavigation($('.learncenter'),["main","schools"])
        subjectApply($('.recruitment_more'), toptype)
        rendering()
        // index = setindex
        // $('.subjectNav_li').eq(setindex).click()
        $(hideList[0]).show()
        $(hideList[1]).hide()
        $(hideList[2]).hide()

      }
      pageinit()
      // li标签点击 需要跳转页面 同时传递第几个 进行初始化
      $('.contentView_li').click(
        function() {
          var index = $(this).index()
          window.location.href = './index.html?index=' + index
        }
      )
      window.addEventListener("hashchange",function(event){
        console.log('hahah')
      });

      // 分类区域选择事件
      $('.learncenterview').on('click', '.educationBackground_li', function () {
        clickchange($(this),'.educationBackground_li','educationBackground_li_active  ')
      })
      // 展开更多
      $('.seemore_span').click(
        function () {
          var index = $(this).attr('id').slice(4)
          console.log($('#text00' + index))
          if($('#text00' + index).hasClass('mainText_school_maxheight')) {
            $('#text00' + index).removeClass('mainText_school_maxheight')
            $(this).text('点击折叠')
          }else {
            $('#text00' + index).addClass('mainText_school_maxheight')
            $(this).text('展开查看更多')
          }
        }
      )
      // 点击图片收藏院校
      $('.ImgSwipperview').on('click', '.addWishImgview_school_img', function () {
        if($(this).attr('src') == './static/images/collect_not.png') {
          $(this).attr('src', './static/images/collect.png')
          $.ajax({
            url: urlhost + '/admin.php/api/users/sch_sc',
            method: 'POST',
            data: {
              uid: store.get('uid'),
              flag: 1,
              sch_id: id
            },
            success: function (res) {
              widowAle(res.msg)
            }
          })
        }else {
          $(this).attr('src', './static/images/collect_not.png')
          $.ajax({
            url: urlhost + '/admin.php/api/users/sch_sc',
            method: 'POST',
            data: {
              uid: store.get('uid'),
              flag: 2,
              sch_id: id
            },
            success: function (res) {
              widowAle(res.msg)
            }
          })
        }
      })
      // 页面初始化 院校数据分类
      function inittype () {
        $.ajax({
          url: urlhost + '/admin.php/api/users/sch_type',
          method: 'POST',
          data: {},
          success: function (res) {
            var data = res.data  
            $('.type_select').html('')
            var typehtml = ''
            for(var i=0; i <data.obj_status.length; i++) {
              typehtml += '<option value="'+ data.obj_status[i].id +'">'+ data.obj_status[i].title +'</option>'
            }
            $('.type_select').html(typehtml)
            $('.back_select').html('')
            var subhtml = ''
            for(var i=0; i <data.major_status.length; i++) {
              subhtml += '<option value="'+ data.major_status[i].id +'">'+ data.major_status[i].title +'</option>'
            }
            $('.back_select').html(subhtml) 
            $('.date_select').html('')
            var datehtml = ''
            for(var i=0; i <data.year.length; i++) {
              datehtml += '<option value="'+ data.year[i].zy_year +'">'+ data.year[i].zy_year +'</option>'
            }
            $('.date_select').html(datehtml)
            var datainit1 = {
              school_id: id
            }
            datainit1.obj_status = $('.first_swipper_table').eq(0).find('.type_select').val()
            datainit1.pc = $('.first_swipper_table').eq(0).find('.back_select').val()
            datainit1.status = 1
            tablereder($('.first_swipper_table').eq(0).find('.table'), datainit1)
            var datainit2 = {
              school_id: id
            }
            datainit2.obj_status = $('.first_swipper_table').eq(1).find('.type_select').val()
            datainit2.pc = $('.first_swipper_table').eq(1).find('.back_select').val()
            datainit2.years = $('.first_swipper_table').eq(1).find('.date_select').val()
            datainit2.status = 2
            tablereder($('.first_swipper_table').eq(1).find('.table'), datainit2)
            var datainit3 = {
              school_id: id
            }
            datainit3.obj_status = $('.first_swipper_table').eq(1).find('.type_select').val()
            datainit3.status = 3
            tablereder($('.first_swipper_table').eq(2).find('.table'), datainit3)
          }
        })
      }


      // 监听选择框变化
      $('.secondSwipper').on('change', '.form-control', function () {
        var indextype = $(this).parents('.swipper_table').index()
        var data = {
          school_id: id,
          status: indextype + 1,
          pc: 0,
          obj_status: 0,
          years: 0
        }
        data.obj_status = $(this).parent().find('.type_select').val()
        data.pc = $(this).parent().find('.back_select').val()
        data.years = $(this).parent().find('.date_select').val()
        // console.log(data)
        tablereder($(this).parents('.swipper_table').find('.table'),data)
      })

      // ajax添加数据到表格
      function tablereder(item, data) {
        $.ajax({
          url: urlhost + '/admin.php/api/users/sch_data',
          method: 'POST',
          data: data,
          success: function (res) {
            if(res.code !== '0') {
              widowAle(res.msg)
            }
            var itemdata = res.data
            var html = ''
            item.find('th').parent().remove()
            for(var i=0; i<itemdata.length; i++) {
              if(data.status == 1) {
                html +=  '<tr>'
                     + '<th>'+ itemdata[i].yx_year +'</th>'
                     + '<th>'+ itemdata[i].codes +'</th>'
                     + '<th>'+ itemdata[i].yx_low_score +'</th>'
                     + '<th>'+ itemdata[i].yx_tdfmc +'</th>'
                     + '<th>'+ itemdata[i].yx_zszy +'</th>'
                  + '</tr>'
              }else if(data.status == 2) {
                html +=  '<tr>'
                     + '<th>'+ itemdata[i].zy_title +'</th>'
                     + '<th>'+ itemdata[i].zy_high_score +'</th>'
                     + '<th>'+ itemdata[i].zy_pj_score +'</th>'
                     + '<th>'+ itemdata[i].zy_low_score +'</th>'
                     + '<th>'+ itemdata[i].zy_lq_num +'</th>'
                  + '</tr>'
              }else if(data.status == 3) {
                html +=  '<tr>'
                     + '<th>'+ itemdata[i].zs_title +'</th>'
                     + '<th>'+ itemdata[i].zs_ccs +'</th>'
                     + '<th>'+ itemdata[i].zs_kl +'</th>'
                     + '<th>'+ itemdata[i].zs_jhs +'</th>'
                  + '</tr>'
              }
            }
            item.append(html)
          }
        })
      }
    })
  </script>
  </body>
</html>
